import request from '@/utils/request'

// 查询商品列表列表
export function listWares(query) {
  return request({
    url: '/mall/wares/list',
    method: 'get',
    params: query
  })
}

// 查询商品列表详细
export function getWares(waresId) {
  return request({
    url: '/mall/wares/' + waresId,
    method: 'get'
  })
}

// 新增商品列表
export function addWares(data) {
  return request({
    url: '/mall/wares',
    method: 'post',
    data: data
  })
}

// 修改商品列表
export function updateWares(data) {
  return request({
    url: '/mall/wares',
    method: 'put',
    data: data
  })
}

// 删除商品列表
export function delWares(waresId) {
  return request({
    url: '/mall/wares/' + waresId,
    method: 'delete'
  })
}

//上传图片
export function upload(data,header) {
  return request({
    url:'/common/upload',
    method:"post",
    headers:header
  })
}
export function changeWaresStatus(classifyId, status) {
  const data = {
    classifyId,
    status
  }
  return request({
    url: '/mall/wares/changeStatus',
    method: 'put',
    data: data
  })
}
